package tau_sadna.tau_map;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RectShape;
import android.graphics.drawable.shapes.RoundRectShape;
import android.graphics.drawable.shapes.Shape;
import android.util.Log;

public class RectBackground extends Drawable {
	
	private Paint stroke;
	private Paint fill;
	private Shape shape;

	public RectBackground() {
		shape = new RectShape();
		fill = new Paint();
		stroke = new Paint();
		fill.setStyle(Paint.Style.FILL);
		stroke.setStyle(Paint.Style.STROKE);
		fill.setColor(Color.WHITE);
		fill.setAlpha(255);
		stroke.setColor(Color.LTGRAY);
		stroke.setAlpha(255);
		stroke.setStrokeWidth(4);
	}

	protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
		

	}

	@Override
	public void draw(Canvas canvas) {
		Rect bounds = getBounds();
		shape.resize(bounds.right-bounds.left, bounds.bottom-bounds.top);
		shape.draw(canvas, fill);
		shape.draw(canvas, stroke);
	}

	@Override
	public int getOpacity() {
		//TODO auto-generated method stub
		return 0;
	}

	@Override
	public void setAlpha(int alpha) {
		fill.setAlpha(alpha);
		
	}

	@Override
	public void setColorFilter(ColorFilter filter) {
		fill.setColorFilter(filter);
	}

}
